#include"Position.h"
using namespace std;
Position::Position()
{
    idx = 0;
    coln = 0;
    ln = 0;
    ftxt = "";
}
Position::Position(int idx,int coln,const string & ftxt,int ln)
{
    this->idx = idx;
    this->coln = coln;
    this->ln = ln;
    this->ftxt = ftxt;
}


void Position::advance(char & current_char)
{
    idx += 1;
    coln += 1;
    current_char = ftxt[idx];
    if(ftxt[idx]=='\n')
    {
        //当前字符为换行符
        coln = 0;
        ln += 1;
    }
}
